<template>
	<view>
		<button type="default" @click="myhttp">点击</button>
		<view>
			{{test.msg}}
		</view>
		<view>
			{{test.up(name)}}
		</view>
	</view>
</template>

<script module="test" lang="wxs">
	var msg = '你好微信s';
	var up = function(str) {
		return str + 'hello'
	}
	module.exports = {
		msg:msg,
		up:up
	}
</script>

<script>
	export default {
		data() {
			return {
				name:'傻逼赵志磊'
			}
		},
		methods: {
			async myhttp() {
				const {
					data,
					meta
				} = await uni.$Http.get(`login`, {
					username: 'admin',
					password: '123456'
				})
				console.log(data)
				uni.setStorage({
					key: 'token',
					data: data.token,
					fail: () => {
						console.log("失败")
					}
				})
			}
		}
	}
</script>

<style>

</style>
